package game.model.converter;

import common.model.po.GBlueprint;
import game.model.request.SaveBlueprintRequest;

/**
 * @author 米泽鹏
 * @since 2024/9/8 18:30
 */
public class GBlueprintConverter {

	public static GBlueprint saveRequestToPo(SaveBlueprintRequest saveBlueprintRequest) {
		if (saveBlueprintRequest == null) {
			return null;
		}
		GBlueprint gBlueprint = new GBlueprint();
		gBlueprint.setId(saveBlueprintRequest.getId());
		gBlueprint.setBlueprintName(saveBlueprintRequest.getBlueprintName());
		gBlueprint.setDescription(saveBlueprintRequest.getDescription());
		gBlueprint.setIsMega(saveBlueprintRequest.getIsMega());
		gBlueprint.setItemCount(saveBlueprintRequest.getItemCount());
		gBlueprint.setCoordinate(saveBlueprintRequest.getCoordinate());
		gBlueprint.setIsOriginalLocationOnly(saveBlueprintRequest.getIsOriginalLocationOnly());
		gBlueprint.setRate(saveBlueprintRequest.getRate());
		gBlueprint.setGameVersion(saveBlueprintRequest.getGameVersion());
		gBlueprint.setAuthorId(saveBlueprintRequest.getAuthorId());
		gBlueprint.setDownloadUrl(saveBlueprintRequest.getDownloadUrl());
		gBlueprint.setConfigDownloadUrl(saveBlueprintRequest.getConfigDownloadUrl());
		gBlueprint.setDownloadCount(saveBlueprintRequest.getDownloadCount());
		gBlueprint.setFileSize(saveBlueprintRequest.getFileSize());
		gBlueprint.setFileSizeUnit(saveBlueprintRequest.getFileSizeUnit());
		gBlueprint.setBlueprintCreateTime(saveBlueprintRequest.getBlueprintCreateTime());
		gBlueprint.setBlueprintUpdateTime(saveBlueprintRequest.getBlueprintUpdateTime());
		gBlueprint.setImages(saveBlueprintRequest.getImages());
		gBlueprint.setIconImage(saveBlueprintRequest.getIconImage());
		gBlueprint.setIconImageBackground(saveBlueprintRequest.getIconImageBackground());
		return gBlueprint;
	}

}
